{% load report_tags %}

{% load default_urls_tags %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Pleso.net Team Stream</title>
</head>
<body>

<table width="800px">
<tr>
	<td>
		{% if projects %}
				
				{% for project in projects %}
				<div class="module">
				<table border="1" cellspacing="0" width="100%">
					<caption><span class="section">Summary report on {{ start|date }}{% ifnotequal start.date end.date %} - {{ end|date }}{% endifnotequal %}</span></caption>
				
					<thead><tr><th colspan="2"><h3>{{ project.name }}</h2></th></tr></thead>
					
					{% include "teamstream/show_report_header.html"%}
					
					{% for work in project.works %}
						{% include "teamstream/show_report_item.html"%}
					{% endfor %}
					
					<thead>
					<tr>
						<th style="text-align: right;">Total:</th>
						<th>{{ project.hours|floatformat:-2 }}</th>
					</tr>
					</thead>
					
					<tr><td colspan="2">
					<div class="module">
					<table border="1" cellspacing="0" width="100%">
						<caption><span class="section">Report by users</span></caption>
						{% for user in project.users %}
							<thead><tr><th colspan="2"><h3>{{ user.get_full_name|default:user.username }}</h2></th></tr></thead>
							{% include "teamstream/show_report_header.html"%}
							{% for work in user.works %}
								{% include "teamstream/show_report_item.html"%}
							{% endfor %}
							<thead>
							<tr>
								<th style="text-align: right;">Total:</th>
								<th>{{ user.hours|floatformat:-2 }}</th>
							</tr>
							</thead> 
						{% endfor %}
					</table>
					</div>
					</td></tr>					
			
				</table>
				</div> <br /><br /><br />
				{% endfor %}
				
		{% else %}
			Nothing to report.
		{% endif %}	
	</td>
</tr>

</body>
</html>